//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//
//------------------------------------------------------------------------------
//
//  File:  image_cfg.h
//
//  Defines configuration parameters used to create the NK and Bootloader
//  program images.
//
#ifndef __IMAGE_CFG_H
#define __IMAGE_CFG_H

#if __cplusplus
extern "C" {
#endif

#include <Littleton.h>

//------------------------------------------------------------------------------
//  RESTRICTION
//
//  This file is a configuration file. It should ONLY contain simple #define 
//  directives defining constants. This file is included by other files that 
//  only support simple substitutions.
//
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//  NAMING CONVENTION
//
//  The IMAGE_ naming convention ...
//
//  IMAGE_<NAME>_<SECTION>_<MEMORY_DEVICE>_[OFFSET|SIZE|START|END]
//
//      <NAME>          - WINCE, BOOT, SHARE
//      <SECTION>       - section name: user defined
//      <MEMORY_DEVICE> - the memory device the block resides on
//      OFFSET          - number of bytes from memory device start address
//      SIZE            - maximum size of the block
//      START           - start address of block    (device address + offset)
//      END             - end address of block      (start address  + size - 1)
//
//------------------------------------------------------------------------------

//
// ARGS data structure location and size
//
#define IMAGE_SHARE_ARGS_UA_START           0xA0000000
#define IMAGE_SHARE_ARGS_CA_START           0x80000000
#define IMAGE_SHARE_ARGS_PA_START           0xBC000000



#define IMAGE_SHARE_ARGS_SIZE               0x00001000

// MOBM Entry
// Location in RAM where MOBM is loaded
#define IMAGE_MOBM_RAM_START                0x5C014000 // 0x5C010000 reserved as per MOBM doc.

#define SDRAM_BASE_VA              0x80000000
#define SDRAM_BASE_UA              0xA0000000
// IPL Entry
// Offset from beginning of RAM where IPL code should be placed (IPL NK section)
#define IMAGE_IPL_RAM_OFFSET				0x03900000
#define IMAGE_IPL_RAM_SIZE				0x00020000

// IPL Entry
#define IMAGE_IPL_RAM_PA_START				(LITTLETON_BASE_PA_SDRAM + IMAGE_IPL_RAM_OFFSET)
#define IMAGE_IPL_RAM_PA_END				(IMAGE_IPL_RAM_PA_START + IMAGE_IPL_RAM_SIZE)
#define IMAGE_IPL_RAM_UA_START				(SDRAM_BASE_UA + IMAGE_IPL_RAM_OFFSET)

// EBoot/IPL Stack location
#define IMAGE_BOOT_STACK_RAM_OFFSET         0x03C00000
#define IMAGE_BOOT_STACK_RAM_UA_START       (SDRAM_BASE_UA + IMAGE_BOOT_STACK_RAM_OFFSET)
#define IMAGE_BOOT_STACK_RAM_PA_START       (LITTLETON_BASE_PA_SDRAM + IMAGE_BOOT_STACK_RAM_OFFSET)

// EBoot configuration data offset in *flash*
#define IMAGE_BOOT_CONFIG_FLASH_OFFSET      0x00040000

#define IMAGE_BOOT_DOWNLOADCACHE_RAM_OFFSET 0x00001000
#define IMAGE_BOOT_DOWNLOADCACHE_RAM_SIZE   0x00080000

#define IMAGE_BOOT_PAGETABLE_OFFSET         0x03A00000
#define IMAGE_BOOT_PAGETABLE_UA             (SDRAM_BASE_UA + IMAGE_BOOT_PAGETABLE_OFFSET)
#define IMAGE_BOOT_PAGETABLE_PA             (LITTLETON_BASE_PA_SDRAM + IMAGE_BOOT_PAGETABLE_OFFSET)

#ifdef BSP_DDR128MB
#define IMAGE_KERNEL_USB_KITL_DMA_BUFFER_OFFSET                    0x07CFF000  //USB2.0 kernel kitl DMA buffer
#else
#define IMAGE_KERNEL_USB_KITL_DMA_BUFFER_OFFSET                    0x03CFF000  //USB2.0 kernel kitl DMA buffer
#endif
#define IMAGE_KERNEL_USB_KITL_DMA_BUFFER_START_PA					(LITTLETON_BASE_PA_SDRAM + IMAGE_KERNEL_USB_KITL_DMA_BUFFER_OFFSET)
#define IMAGE_KERNEL_USB_KITL_DMA_BUFFER_START_UA					(SDRAM_BASE_UA + IMAGE_KERNEL_USB_KITL_DMA_BUFFER_OFFSET)

#define IMAGE_U2DKITL_START_PA					0x5C020000
#define IMAGE_U2DKITL_START_UA					0xABB20000        //USB2.0 eboot kitl DMA buffer

#define IMAGE_BLOCK_ZERO_BACKUP_PA    (LITTLETON_BASE_PA_SDRAM + 0x01000000)  // in large block nand flash, one block has 0x20000 bytes

//	9F0C0000	
//		Partition Table
// 	9F0B0000
//		NK Partition
#define IMAGE_BOOT_DEBUGNK_UA				0x9F0A0000

// MVED & Display Driver's shared, reserved frame buffer
// The following must be kept in sync with config.bib, memory.cfg.xml, image_cfg.inc!!!!
#ifdef BSP_DDR128MB
#define IMAGE_RSVD_MVED_BUFFER_PA       (LITTLETON_BASE_PA_SDRAM + 0x074FF000) 
#define IMAGE_RSVD_DISPLAY_BUFFER_PA    (LITTLETON_BASE_PA_SDRAM + 0x07CFF000) 
#else
#define IMAGE_RSVD_MVED_BUFFER_PA       (LITTLETON_BASE_PA_SDRAM + 0x034FF000)    
#define IMAGE_RSVD_DISPLAY_BUFFER_PA    (LITTLETON_BASE_PA_SDRAM + 0x03CFF000)
#endif

#define IMAGE_RSVD_MVED_BUFFER_SIZE     0x00800000
#define IMAGE_RSVD_DISPLAY_BUFFER_SIZE  0x00301000

//------------------------------------------------------------------------------

#if __cplusplus
}
#endif

#endif 
